home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / mkmf / RCS / mkmf.man,v < prev    next >
Encoding:
Text File  |  1989-10-10  |  2.3 KB  |  110 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @@;
  7.  
  8.  
  9. 1.2
  10. date     89.10.09.21.28.25;  author rab;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     89.01.09.10.56.35;  author ouster;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 1.2
  25. log
  26. @Modifications for distribution.
  27. @
  28. text
  29. @#!/sprite/cmds/csh -f
  30. #
  31. # A script to generate (or regenerate) the Makefile for a directory
  32. # consisting solely of header files.
  33. #
  34. # We assume we were invoked from mkmf.  Parameters passed in from mkmf
  35. # through environment variables:
  36. #
  37. #    MKMFDIR        directory containing prototype makefiles
  38. #    MAKEFILE    name of makefile to create
  39. #    SUBTYPE        additional information, telling whether this
  40. #            is an X directory, Sprite directory, etc.
  41. #
  42.  
  43. #
  44. # Argument processing.  (Generalized form, even though just one flag so far.)
  45. #
  46. while ($#argv >= 1)
  47.     if ("$1" == '-x') then
  48.     set echo
  49.     endif
  50.     shift
  51. end
  52.  
  53. set name=`expr $cwd : '.*/man/\(.*\)$'`
  54. set subtype=$SUBTYPE
  55. set makefile=$MAKEFILE
  56. set distdir=($DISTDIR)
  57.  
  58. if (-e $makefile.proto) then
  59.     set proto=$makefile.proto
  60. else
  61.     set proto="${MKMFDIR}/Makefile.man"
  62. endif
  63.  
  64. echo "Generating a Makefile for $name manual entries using $proto"
  65.  
  66. set nonomatch
  67. set manPages =( *.man )
  68. #
  69. # Check to see if there were any man pages.  The first check (size == 1)
  70. # is only necessary because the second check will cause an error if
  71. # hdrs contains more than 1024 bytes.
  72. #
  73. if ($#manPages == 1) then
  74.     if ("$manPages" == "*.man") set manPages=()
  75. endif
  76. unset nonomatch
  77.  
  78. #
  79. # Use sed to substitute various interesting things into the prototype
  80. # makefile. The code below is a bit tricky because some of the variables
  81. # being substituted in can be very long:  if the substitution is passed
  82. # to sed with "-e", the entire variable must fit in a single shell argument,
  83. # with a limit of 1024 characters.  By generating a separate script file
  84. # for the very long variables, the variables get passed through (to the
  85. # script file) as many arguments, which gets around the length problem.
  86. #
  87.  
  88. rm -f mkmf.tmp.sed
  89. echo s,"@@(MANPAGES)",$manPages,g > mkmf.tmp.sed
  90. cat $proto | sed -f mkmf.tmp.sed \
  91.     -e "s,@@(DATE),`date`,g" \
  92.     -e "s,@@(MAKEFILE),$makefile,g" \
  93.     -e "s,@@(NAME),$name,g" \
  94.     -e "s,@@(TEMPLATE),$proto,g" \
  95.     -e "s,@@(TYPE),$subtype,g" \
  96.     -e "s,@@(DISTDIR),$distdir,g" \
  97.     > $makefile
  98. rm -f mkmf.tmp.sed
  99. @
  100.  
  101.  
  102. 1.1
  103. log
  104. @Initial revision
  105. @
  106. text
  107. @d28 1
  108. d68 1
  109. @
  110.